<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/10/16
  Time: 10:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
        String username = request.getParameter("username");
    %>
    用户名为：
    <%=username%>
<%--    <hr>
    <% out.print("out="+username)%>
    <hr>
    <% response.getWriter().write("response = "+username);%>
    --%>
    <hr>
    <!--为不同的域设置内容-->
    <%
        pageContext.setAttribute("user","page_user");
        pageContext.setAttribute("user","new_quest_user",PageContext.REQUEST_SCOPE);
        pageContext.setAttribute("user","new_session_user",PageContext.SESSION_SCOPE);
        pageContext.setAttribute("user","new_app_user",PageContext.APPLICATION_SCOPE);
    %>
<%
    /*从不同的域中取值的*/
    String user1 = (String) request.getAttribute("user");
    String userSession = (String) session.getAttribute("user");
    String userapp = (String) application.getAttribute("user");
    String userpage =(String) pageContext.getAttribute("user");
%>
    <!--显示取出来的值-->
<%= user1%> <br>
<%= userSession%> <br>
<%= userapp%> <br>
<%= userpage%>
</body>
</html>
